<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>Title</title>

    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <!-- 引入样式 -->
    <link rel="stylesheet" href="https://unpkg.com/element-ui/lib/theme-chalk/index.css">
    <link rel="stylesheet" href="../plugins/font-awesome/css/font-awesome.min.css">
    <link rel="stylesheet" href="../css/style.css">
</head>
<body>
<div id="app">
    <div class="content-header">
        <h1><small>员工管理</small></h1>
        <el-breadcrumb separator-class="el-icon-arrow-right" class="breadcrumb">
            <el-breadcrumb-item :to="{ path: '/' }">首页</el-breadcrumb-item>
            <el-breadcrumb-item>管理</el-breadcrumb-item>
            <el-breadcrumb-item>brand管理</el-breadcrumb-item>
        </el-breadcrumb>
    </div>

    <div class="app-container">
        <div class="box">
            <div class="filter-container">
                <!--查询表单-->
                <el-form :inline="true" >
                    <el-form-item label="品牌名称">
                        <el-input v-model="searchMap.name" placeholder="品牌名称" class="filter-item" ></el-input></el-form-item>

                    <el-form-item label="品牌的首字母">
                        <el-input v-model="searchMap.letter" placeholder="品牌的首字母" class="filter-item" ></el-input></el-form-item>


                    <el-button class="dalfBut" @click="fetchData()">查询</el-button>
                    <el-button type="primary"  class="butT" @click="formVisible=true;pojo={}">新增</el-button>
                </el-form>
            </div>

            <el-table :data="tableData" border style="width: 100%">
                <el-table-column prop="eid" label="员工id" width="150"></el-table-column>
                <el-table-column prop="ename" label="员工姓名" width="300"></el-table-column>
                <el-table-column prop="sex" label="性别" width="150"></el-table-column>
                <el-table-column prop="birth" label="生日" width="150"></el-table-column>
                <el-table-column prop="jointime" label="入职时间" width="150"></el-table-column>
                <el-table-column prop="xueli" label="学历" width="150"></el-table-column>
                <el-table-column prop="pid" label="职位" width="150"></el-table-column>
                <el-table-column prop="address" label="地址" width="150"></el-table-column>
                <el-table-column prop="phone" label="电话" width="150"></el-table-column>
                <el-table-column prop="did" label="部门" width="150"></el-table-column>

                <el-table-column
                        label="操作"  >
                    <!--<template slot-scope="scope">
                        <el-button @click="edit(scope.row.id)" size="mini" type="primary" size="small">修改</el-button>
                        <el-button @click="dele(scope.row.id)" size="mini" type="danger" size="small">删除</el-button>
                    </template>-->
                </el-table-column>
            </el-table>

            <div class="add-form">
                <!--弹出窗口-->
                <el-dialog  title="编辑" :visible.sync="formVisible" >
                    <el-form label-width="80px">
                        <el-form-item label="品牌名称"><el-input v-model="pojo.name"></el-input></el-form-item>


                        <el-form-item label="品牌的首字母"><el-input v-model="pojo.letter"></el-input></el-form-item>
                        <el-form-item label="排序"><el-input v-model="pojo.seq"></el-input></el-form-item>


                        <el-form-item>
                            <el-button type="primary" @click="save()">保存</el-button>
                            <el-button @click="formVisible = false" >关闭</el-button>
                        </el-form-item>
                    </el-form>
                </el-dialog>
            </div>

        </div>
    </div>
</div>
</body>
<script src="../js/vue.js"></script>
<script src="../js/axios.js"></script>
<script src="../js/elementui.js"></script>
<script>
    new Vue({
        el: "#app",
        data(){
            return {
                tableData: [],
                searchMap: {},
                pojo: {},
                formVisible: false,
            }

        },
        created(){
            this.findList();
        },
        methods:{

            findList (){
                axios.get(`/employee/findEmployee`).then(response => {
                    this.tableData = response.data.data;
                });
            }
        }
    })
</script>
</html>